<?php

namespace Biz\Resources\Site;

use Biz\Dictionaries\Paper\PaperFullStatusDict;
use Biz\Models\User\User;
use Lumen\Http\Resources\Json\Resource;
use Biz\Constants\Site\SitePaperFullConstants;

/**
 * SitePaperFullResource.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class SitePaperFullResource extends Resource
{
    /**
     * Transform the resource into an array.
     *
     * @param \Illuminate\Http\Request $request
     *
     * @return array
     */
    public function toArray($request)
    {
        /** @var \Biz\Models\User\User $user */
        //$user = $request->user();

        return [
            'uid'             => $this->uid,
            'file_url'        => $this->file_url,
            'status'          => $this->status,
            'status_name'     => PaperFullStatusDict::get($this->status),
            'created_at'      => $this->created_at->getTimestamp(),
        ];
    }

//    /**
//     * Get status name.
//     *
//     * @param User $user
//     *
//     * @return string
//     */
//    public function getStatusName(User $user): string
//    {
//        if ($user->isClient()) {
//            return SitePaperFullConstants::$ClientStatusNames[$this->status];
//        } elseif ($user->isMember()) {
//            return SitePaperFullConstants::$MemberStatusNames[$this->status];
//        }
//
//        return '';
//    }
}
